﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RendicionVentaItemGrid.ascx.cs" 
Inherits="UILGestion.VentaAdmin.RendicionVenta.RendicionVentaItemGrid" %>
 
  <%@ Register assembly="WebLib" namespace="WebLib" tagprefix="lib" %>
 <input id="internalID" type="hidden" runat="server" />
  <input id="idColeccion" type="hidden" runat="server" />
  <input id="idConcepto" type="hidden" runat="server" />
  

<asp:UpdatePanel ID="itemUpdatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>  
   <asp:GridView ID="itemGridView" runat="server" DataKeyNames="idInternal" ShowFooter="false"
    onrowcancelingedit="CancelItem" ShowHeader="true" 
                            onrowediting="EditItem" 
                            OnRowUpdating="UpdateItem" 
                                 ShowHeaderWhenEmpty="true" SkinID="GridView" >
                                 <Columns>
                                 <asp:TemplateField HeaderStyle-Width="80px" HeaderText="CODIGO">
                                         <ItemTemplate>
                                             <asp:Label ID="codigoLabel" runat="server" Text='<%# Eval("numDocumento")%>' 
                                                 Width="80px"></asp:Label>
                                                 
                                         </ItemTemplate>
                                         <EditItemTemplate>
                                             <asp:Label ID="codigoTextBox" runat="server" BackColor="Transparent" 
                                                 Text='<%# Eval("numDocumento")%>' />
                                                 
                                         </EditItemTemplate>
                                         <FooterTemplate>
                                             
                                                 


                                         </FooterTemplate>
                                     </asp:TemplateField>

                                     <asp:TemplateField HeaderStyle-Width="150px" HeaderText="CONCEPTO">
                                         <ItemTemplate>
                                             <asp:Label ID="conceptoLabel" runat="server" Text='<%# Eval("concepto")%>' 
                                                 ></asp:Label>
                                                 
                                         </ItemTemplate>
                                         <EditItemTemplate>
                                             <asp:Label ID="conceptoEditTXT" runat="server" BackColor="Transparent" 
                                                 Text='<%# Eval("concepto")%>'  />
                                                 
                                         </EditItemTemplate>
                                         <FooterTemplate>
                                             <lib:Input ID="conceptoEditTXT" runat="server" BackColor="Transparent" 
                                                 ReadOnly="true"  />
                                                 


                                         </FooterTemplate>
                                     </asp:TemplateField>


                                       <asp:TemplateField  HeaderText="ORDEN VENTA" ItemStyle-HorizontalAlign="Right" >
                                         
                                         <ItemTemplate>
                                              <asp:Hyperlink runat= "server"  ForeColor="Blue"
                                           Text='<%# DataBinder.Eval(Container.DataItem,"ordenVenta").ToString()%>'  
                                             Target="_self"  ID="Hyperlink2"
                                            NavigateUrl='<%# "~/VentaAdmin/OrdenVenta/OrdenVentaReadForm.aspx?id=" + 
                                            DataBinder.Eval (Container.DataItem,"idOrdenVenta").ToString()  +
                                            "&idProyecto=" + DataBinder.Eval (Container.DataItem,"idProyecto").ToString()
                                            %>' 
                                           />   
                                         </ItemTemplate>
                                     </asp:TemplateField>

                                     

                                      <asp:TemplateField  HeaderText="REFERENCIA" ItemStyle-HorizontalAlign="Left">
                                         
                                         <ItemTemplate>
                                             <asp:Label ID="referenciaLabel" runat="server" 
                                             Text='<%# Eval("referencia")%>'></asp:Label>
                                           
                                         </ItemTemplate>
                                     </asp:TemplateField>

                                     <asp:TemplateField HeaderStyle-Width="300px" HeaderText="LOCALIZACION UI">
                                         <ItemTemplate><asp:Label ID="etapaLabel" runat="server" 
                                             Text='<%# Eval("etapa")%>'></asp:Label>-
                                             <asp:Label ID="localizacionLabel" runat="server" 
                                             Text='<%# Eval("localizacion")%>' ></asp:Label> -
                                            <asp:Label ID="UILabel" runat="server" 
                                             Text='<%# Eval("UIStr")%>' ></asp:Label>
                                         </ItemTemplate>
                                       
                                     </asp:TemplateField>
                                    
                               
                                     <asp:TemplateField ControlStyle-Width="120px" HeaderStyle-Width="120px" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                         HeaderText="TOTAL" >
                                         <ItemTemplate>
                                             <asp:Label ID="totalOrigLabel" runat="server" Text='<%# Eval("totalOrigenStr")%>' />
                                         </ItemTemplate>
                                         <EditItemTemplate>
                                             <lib:Input ID="totalOrigTextBox" runat="server"   DataType="Double" Enabled="false" BackColor="Transparent"
                                                 Text='<%# Eval("totalOrigen")%>' Width="120px"></lib:Input>
                                         </EditItemTemplate>
                                         <FooterTemplate>
                                             <lib:Input ID="totalOrigTextBox" runat="server" BackColor="Transparent"   Enabled="false"
                                                 ReadOnly="true" Width="120px"></lib:Input>
                                         </FooterTemplate>
                                     </asp:TemplateField>
    
                                     <asp:TemplateField ControlStyle-Width="120px" HeaderStyle-Width="120px" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                         HeaderText="TOTAL" >
                                         <ItemTemplate>
                                             <asp:Label ID="totalLabel" runat="server" Text='<%# Eval("totalStr")%>' />
                                         </ItemTemplate>
                                         <EditItemTemplate>
                                             <lib:Input ID="totalTextBox" runat="server"   DataType="Double"
                                                 Text='<%# Eval("total")%>' Width="120px"></lib:Input>
                                         </EditItemTemplate>
                                         <FooterTemplate>
                                             <lib:Input ID="totalTextBox" runat="server" BackColor="Transparent"  
                                                 ReadOnly="true" Width="120px"></lib:Input>
                                         </FooterTemplate>
                                     </asp:TemplateField>

                                <asp:CommandField ButtonType="Image" CancelImageUrl="~/Images/cancel.gif" 
                                        EditImageUrl="~/Images/edit.gif" ShowEditButton="true" 
                                        UpdateImageUrl="~/Images/update.gif" />



                                     <asp:TemplateField>
                                         <FooterTemplate>
                                            <%-- <asp:Button ID="addProvAdd" runat="server" OnClick="AddItem" Text="Añadir" />--%>
                                         </FooterTemplate>
                                         <ItemTemplate>
                                             <asp:ImageButton ID="lnkRemove" runat="server" BorderColor="Control" 
                                                 CommandArgument='<%# Eval("idInternal")%>' ImageUrl="~/Images/delete.gif" 
                                                 OnClick="DeleteItem" 
                                                 OnClientClick="return confirm('Usted quiere eliminar?')" />
                                         </ItemTemplate>
                                     </asp:TemplateField>
                                 </Columns>
                             </asp:GridView>

                  

</ContentTemplate>
</asp:UpdatePanel>